import request from '@/utils/request'

// 获取短视频列表
export const getShortVideoList = (data?: {
    page?: number
    limit?: number
    keyword?: string
}) => {
    return request({
        url: '/short_video/list',
        method: 'POST',
        data
    })
}

// 获取短视频详情
export const getShortVideoById = (data: { video_id: number }) => {
    return request({
        url: '/short_video/detail',
        method: 'POST',
        data
    })
}

// 播放短视频
export const playShortVideo = (data: { video_id: number }) => {
    return request({
        url: '/short_video/play',
        method: 'POST',
        data
    })
}

// 点赞短视频
export const likeShortVideo = (data: { video_id: number }) => {
    return request({
        url: '/short_video/like/create',
        method: 'POST',
        data
    })
}

// 取消点赞短视频
export const unlikeShortVideo = (data: { video_id: number }) => {
    return request({
        url: '/short_video/like/delete',
        method: 'POST',
        data
    })
}

// 获取短视频点赞列表
export const getShortVideoLikeList = (data: {
    video_id: number;
    page?: number;
    limit?: number
}) => {
    return request({
        url: '/short_video/like/list',
        method: 'POST',
        data
    })
}

// 创建短视频评论
export const createShortVideoComment = (data: {
    video_id: number;
    content: string;
    reply_to_comment_id?: number
}) => {
    return request({
        url: '/short_video/comment/create',
        method: 'POST',
        data
    })
}

// 删除短视频评论
export const deleteShortVideoComment = (data: { comment_id: number }) => {
    return request({
        url: '/short_video/comment/delete',
        method: 'POST',
        data
    })
}

// 获取短视频评论列表
export const getShortVideoCommentList = (data: {
    video_id: number;
    page?: number;
    limit?: number
}) => {
    return request({
        url: '/short_video/comment/list',
        method: 'POST',
        data
    })
}